<?php 

//定义网站关键字
if(!function_exists('regkeys')){
    function regkeys($var) {
        $lang=$_GET['lg']=='en'?" and lg='en' ":" and lg='zh'";
        static $temp='';
        if($temp=='') {
            $temp=Go('base',"and del!=1 {$lang} limit 1");
        }
        return $temp[$var];
    }
}

function get_lang_con(){
    //多语言
    switch($_GET['lg']){
        case 'en':
            $lang = " and lg='en'";
            break;
        case 'jp':
            $lang = " and lg='jp'";
            break;
        case 'ru':
            $lang = " and lg='ru'";
            break;
        case 'zh':
        default:
            $lang = " and lg='zh'";
            break;
    }
    return $lang;
}

function the_copyright($field='title'){
    static $copy;
    if ($copy == ''){
        $copy = Go('copyright'," and sortid=62 {$lang} and del!=1 limit 1");
    }
    return $copy[$field];
}

function the_leftbar($field='title'){
    static $leftbar;
    if ($leftbar == ''){
        $leftbar = Go('leftbar'," and sortid=28 and del!=1 limit 1");
    }
    return $leftbar[$field];
}


/**
 * 返回banner选中状态class
 * 根据当前Controller进行判断
 * @param $controller	栏目Controller
 * @param $rString		返回字符串，这里返回的是banner的DIV class
 */
function get_banner_status($controller,$rString='banner_on'){
    if ( strtolower(Bic_Router::getCurrentController()) == strtolower($controller))
    return $rString;
}
